<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ page pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<html>
	<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script type="text/javascript">
    	$(document).ready(function(){
    		set_input_keydown_event();
    		$('#roleid').combobox();
    		combobox_keypress('#roleid', '#save');
     		$('#mod_manager_detail_panel').window({onOpen:function(){
     		  $('#name').focus();
     		}});
    	});

     	$('#save').click(function (){
     		  $('#roleid_val').val($('#roleid').combobox('getValue'));
    		  $('#mod_manager_form').form('submit', {
    		    url: 'modManager.action',error:function(message){
    		    	alert('提交数据错误，服务器可能已关闭！系统返回:'+message);
    		  	},
    		    success:function(data){
    		      var a = eval('(' + data + ')');
    		      $.messager.alert('修改管理员', a.message, 'info', 
    		        function(){$('#name').focus()});
    		      
    		      if (a.result=='0'){
                      var $tbl = $('#manager_table');
                      var row = $tbl.datagrid('getSelected');
                      var index = $tbl.datagrid('getRowIndex',row);
                      row.name=$('#name').val();
                      row.identifyno=$('#identifyno').val();
                      row.rolename=$('#roleid').combobox('getText');
                      row.address=$('#address').val();
                      row.telephone=$('#telephone').val();
                      row.roleid=$('#roleid_val').val();
                      $tbl.datagrid('refreshRow', index);
    		          $('#mod_manager_detail_panel').window('close');
    		      }
    		    }
    		 })
    	});

     	$('#cancel').click(function (){
     		$('#mod_manager_detail_panel').window('close');
    	});
    </script>
	</head>
	<body>
	
    <div id="mod_manager_detail_panel" collapsible="false" fit="false" title="修改管理员" 
    	resizable="false" collapsible="false" minimizable="false" maximizable="false" 
    	closable="true" closed="true" icon="icon-save" modal="true" class="jquery_window">
    	<s:form id="mod_manager_form" action="modManager" cssStyle="margin:20px,50px"
    		theme="simple">
    		<table>
    			<tr height="24px">
    				<td><s:label value="所属机构："></s:label></td>
    				<td><input id="deptno" style="width:200px"
			    		class="text_field_css" disabled="disabled"></input></td>
    			</tr>
    			<tr height="24px">
    				<td><s:label value="管理员号："></s:label></td>
    				<td><input id="workno" style="width:200px"
			    		class="text_field_css" disabled="disabled">
    					<s:hidden id="workno_val" name="workno"></s:hidden></td>
    			</tr>
    			<tr height="24px">
    				<td><s:label value="姓名：" for="name"></s:label></td>
			    	<td><input id="name" name="name" style="width:200px"
    					maxlength=<s:property value="%{getText('NAME_LEN')}"/>  
    					class="text_field_css"></input><label style="width:4px"></label>
			    		<label style="color:red">*</label><label>必输项</label></td>
    			</tr>
    			<tr height="24px">
			    	<td><s:label value="身份证号：" for="identifyno"></s:label></td>
    				<td><input id="identifyno" name="identifyno" style="width:200px" 
    					maxlength=<s:property value="%{getText('IDENTIFYNO_LEN')}"/>  
			    		class="text_field_css"></input><label style="width:4px"></label>
			    		<label style="color:red">*</label><label>必输项</label></td>
    			</tr>
    			<tr height="24px">
			    	<td><s:label value="住址：" for="address"></s:label></td>
    				<td><input id="address" name="address" style="width:250px" 
    					maxlength=<s:property value="%{getText('ADDRESS_LEN')}"/>  
			    		class="text_field_css"></input></td>
    			</tr>
    			<tr height="24px">
			    	<td><s:label value="电话：" for="telephone"></s:label></td>
    				<td style="width:200px"><input id="telephone" name="telephone" 
    					maxlength=<s:property value="%{getText('TELEPHONE_LEN')}"/>  
			    		style="width:200px" class="text_field_css"></input></td>
    			</tr>
			    <tr height="28px">
    				<td><s:label value="角色：" for="roleid"></s:label></td>
			    	<td><input id="roleid" editable="false" valueField="roleno" 
			    		textField="rolename" style="width:250px" panelHeight="auto" 
			    		url="queryRoleList.action"/>
			    		<s:hidden id="roleid_val" name="roleid"/></td>
			    </tr>
    			<tr>
    				<td colspan="2" align="center">
            			<button id="save" class="buttons_css" style="width:70px">
            				<label style="70px" class="save_css">保存</label></button>
            			<label style="width:20px"></label>
            			<button id="cancel" class="buttons_css" style="width:70px">
            				<label style="70px" class="cancel_css">返回</label></button>
    				</td>
    			</tr>
    		</table>
    	</s:form>
    </div>
    </body>
</html>